<template>
	<view>
		<u-empty v-if="listData.length==0" marginTop='100' mode="data"
			:icon="require('@/static/mine/empty.png')"></u-empty>
		<view @click="toPage('/pages_two/project/projectDetail',item.baseId)" v-for="(item,index) in listData"
			:key="index" class="p-area">
			<view class="between_layout">
				<view class="p-name">{{item.projectName}}</view>
				<view style="flex-shrink: 0;">
					<view v-if="entryStatus==4">
						<u-tag plain size="mini" v-if="item.projectCompletion==-1" text="竣工未填报" color="#999"
							borderColor="#999"></u-tag>
						<u-tag plain size="mini" v-if="item.projectCompletion==2" text="竣工审核退回" type="error"></u-tag>
						<u-tag plain size="mini" v-if="item.projectCompletion==1" text="竣工待审核" type="warning"></u-tag>
						<u-tag plain size="mini" v-if="item.projectCompletion==0" text="竣工审核通过" type="success"></u-tag>
					</view>
					<view v-if="entryStatus==5">
						<u-tag plain size="mini" v-if="item.projectProduction==-1" text="投产未填报" color="#999"
							borderColor="#999"></u-tag>
						<u-tag plain size="mini" v-if="item.projectProduction==2" text="投产审核退回" type="error"></u-tag>
						<u-tag plain size="mini" v-if="item.projectProduction==1" text="投产待审核" type="warning"></u-tag>
						<u-tag plain size="mini" v-if="item.projectProduction==0" text="投产审核通过" type="success"></u-tag>
					</view>
					<view v-if="entryStatus==6">
						<u-tag plain size="mini" v-if="item.projectEfficiency==-1" text="达效未填报" color="#999"
							borderColor="#999"></u-tag>
						<u-tag plain size="mini" v-if="item.projectEfficiency==2" text="达效审核退回" type="error"></u-tag>
						<u-tag plain size="mini" v-if="item.projectEfficiency==1" text="达效待审核" type="warning"></u-tag>
						<u-tag plain size="mini" v-if="item.projectEfficiency==0" text="达效审核通过" type="success"></u-tag>
					</view>
				</view>
			</view>
			<view class="type-area start_layout solid-bottom">
				<view class="start_layout type-item">
					<view class="cuIcon-discover type-icon"></view>先进制造业
				</view>
				<view class="start_layout type-item">
					<view class="cuIcon-read type-icon"></view>新材料
				</view>
				<view class="start_layout type-item">
					<view class="cuIcon-circle type-icon"></view>智能装备
				</view>
			</view>
			<view style="margin-top: 20rpx;" class="between_layout">
				<view class="money-area">总投资：{{item.investmentTotal}}万元</view>
				<view class="end_layout" v-if="entryStatus==4">
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectCompletion==1&&roles.indexOf('company')==-1"
						@click.native.stop="toInnerInfo(item.baseId,4)" text="竣工审核" type="primary"
						size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}" v-if="item.projectCompletion==-1"
						@click.native.stop="toPage('/pages_two/subForm/completeForm',item.baseId)" text="竣工申请"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectCompletion==0||item.projectCompletion==2"
						@click.native.stop="toPage('/pages_two/subForm/completeForm',item.baseId)" text="修改竣工信息"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx',marginLeft:'10rpx'}"
						v-if="item.projectCompletion==2" @click.native.stop="toInnerInfo(item.baseId,4)" text="驳回原因"
						type="error" size="small"></u-button>
				</view>
				<view class="end_layout" v-if="entryStatus==5">
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectProduction==1&&roles.indexOf('company')==-1"
						@click.native.stop="toInnerInfo(item.baseId,5)" text="投产审核" type="primary"
						size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}" v-if="item.projectProduction==-1"
						@click.native.stop="toPage('/pages_two/subForm/productionForm',item.baseId)" text="投产申请"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectProduction==0||item.projectProduction==2"
						@click.native.stop="toPage('/pages_two/subForm/productionForm',item.baseId)" text="修改投产信息"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx',marginLeft:'10rpx'}"
						v-if="item.projectProduction==2" @click.native.stop="toInnerInfo(item.baseId,5)" text="驳回原因"
						type="error" size="small"></u-button>
				</view>
				<view class="end_layout" v-if="entryStatus==6">
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectEfficiency==1&&roles.indexOf('company')==-1"
						@click.native.stop="toInnerInfo(item.baseId,6)" text="达效审核" type="primary"
						size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}" v-if="item.projectEfficiency==-1"
						@click.native.stop="toPage('/pages_two/subForm/effectiveForm',item.baseId)" text="达效申请"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx'}"
						v-if="item.projectEfficiency==0||item.projectEfficiency==2"
						@click.native.stop="toPage('/pages_two/subForm/effectiveForm',item.baseId)" text="修改达效信息"
						type="primary" size="small"></u-button>
					<u-button :customStyle="{height: '50rpx',borderRadius: '10rpx',marginLeft:'10rpx'}"
						v-if="item.projectEfficiency==2" @click.native.stop="toInnerInfo(item.baseId,6)" text="驳回原因"
						type="error" size="small"></u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				roles: [],
			}
		},
		props: {
			listData: {
				type: Array,
				default: () => []
			},
			//当前入库状态，4为竣工，5为投产，6为达效
			entryStatus: {
				type: Number,
				default: null
			},
		},
		mounted() {
			this.roles = uni.getStorageSync("roleinfo")
		},
		methods: {
			toPage(url, id) {
				uni.navigateTo({
					url: url + '?id=' + id
				})
			},
			toInnerInfo(item, index) {
				uni.navigateTo({
					url: '/pages_two/project/projectDetail?id=' + item + '&tabIndex=' + index
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.circle-box {
		width: 14px;
		height: 14px;
		border-radius: 50%;
		margin-right: 4px;
	}

	.circle-name {
		font-family: Microsoft YaHei;
		font-weight: 400;
		font-size: 14px;
		color: #333333;
		margin-right: 30px;
	}

	.p-area {
		background: #FFFFFF;
		border-radius: 10rpx;
		padding: 30rpx;
		margin-bottom: 30rpx;
		position: relative;

		.entryStatus-area {
			position: absolute;
			right: 0;
			top: 0;
			background: linear-gradient(156deg, #FFB56D 0%, #FF6F0E 100%);
			padding: 6rpx 16rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #FFFFFF;
			border-radius: 0 10rpx 0 20rpx;
		}

		.state-area {
			.state-item {
				margin-right: 10rpx;
				width: 31rpx;
				height: 31rpx;
				background: rgba(51, 137, 255, 0.12);
				border-radius: 4rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: bold;
				font-size: 20rpx;
			}
		}

		.p-name {
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 30rpx;
			color: #333333;
			margin-right: 20rpx;
		}

		.type-area {
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #999999;
			padding: 20rpx 0;

			.type-item {
				margin-right: 40rpx;
			}

			.type-icon {
				color: #3389FF;
				margin-right: 10rpx;
			}
		}

		.money-area {
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 24rpx;
			color: #3389FF;
			background: rgba(51, 137, 255, 0.1);
			border-radius: 6rpx;
			padding: 9rpx 14rpx;
		}
	}

	.demo-box {
		width: 35px;
		height: 20px;
		position: relative;
		border-radius: 5rpx;
		flex-shrink: 0;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 20rpx;
		color: #FFFFFF;
		margin-right: 20rpx;
	}

	#demo1 {
		background-color: #08B966;
	}

	#demo1:before {
		border: solid transparent;
		content: ' ';
		height: 0;
		left: 100%;
		position: absolute;
		width: 0;
		border-width: 6px;
		border-left-color: #08B966;
		top: 3px;
	}

	#demo3 {
		background-color: #F2270C;
	}

	#demo3:before {
		border: solid transparent;
		content: ' ';
		height: 0;
		left: 100%;
		position: absolute;
		width: 0;
		border-width: 6px;
		border-left-color: #F2270C;
		top: 3px;
	}

	#demo2 {
		background-color: #FD8A19;
	}

	#demo2:before {
		border: solid transparent;
		content: ' ';
		height: 0;
		left: 100%;
		position: absolute;
		width: 0;
		border-width: 6px;
		border-left-color: #FD8A19;
		top: 3px;
	}
</style>